
import broker.yahooJapanAuction.UrlExtractorFromList;
import controller.UCSetImgFolder;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JFrame;
import model.db.Execute;
import model.db.OurConnection;
import model.db.table.Bid;
import model.db.table.BidHistory;
import view.ImagePanel;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jc218934
 */
public class test
{
    public static void test1()
    {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new ImagePanel("http://f2.auctions.c.yimg.jp/f45batchimg.auctions.yahoo.co.jp/users/7/6/0/2/k_a_company1818-thumb-1312277362448580.jpg"));
        frame.setSize(800, 600);
        frame.setVisible(true);
        frame.repaint();
    }

    public static void test2 ()
    {
        OurConnection.connect();
    }

    public static void test3()
    {
        try
        {
            String stringToExecute = "SELECT * FROM sqlite_master";
            Connection con = OurConnection.connect();
            if (con == null) System.out.println("null");
            Statement stmt = con.createStatement();
            System.out.println(stringToExecute);
            ResultSet result = stmt.executeQuery(stringToExecute);


            if(result !=null)
            {
                for (;result.next();)
                {
                    try
                    {
                        for (int i=1;i<6;i++)
                        {
                            System.out.println(result.getString(i));
                        }
                    }
                    catch (Exception exc)
                    {
                        System.out.println("exc"+exc);
                    }
                }
            }
            stmt.close(); // close the Statement
            con.close();
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }

    }

    private static void test4()
    {
        BidHistory.createTable();
        Bid.createTable();
    }

    private static void test5()
    {
        Execute.execute("drop table BID_HISTORY");
        Execute.execute("drop table BID");
    }

    private static void test6()
    {
        String tmpStr = "81,000";
        tmpStr = tmpStr.replaceAll(",", "");

        Double.parseDouble(tmpStr);
    }

    private static void test7()
    {
        new UCSetImgFolder().run();
    }

    public static void main(String[] args)
    {
        test5();
        test4();
    }
}

